import axios from '@/libs/api.request'
import { getToken } from '@/libs/util'

class DeviceAlarm {
  constructor() {
    this.$axios = axios;
  }
  countGroupByCatePage = (param) => {
    return axios.request({
      url: '/admin/device/alarm/statistics/group/by/cate/page/',
      method: 'post',
      dataType: 'json',
      headers: {
        'Content-Type': 'application/json; charset=UTF-8',
        'token': getToken()
      },
      data: param
    })
  }

  queryPage = (param) => {
    return axios.request({
      url: '/admin/device/alarm/query/page/',
      method: 'post',
      dataType: 'json',
      headers: {
        'Content-Type': 'application/json; charset=UTF-8',
        'token': getToken()
      },
      data: param
    })
  }

  getDeviceAlarmCate=()=>{
    return axios.request({
      url: '/admin/device/alarm/query/alarm/cate',
      method: 'get',
      dataType: 'json',
      headers: {
        'Content-Type': 'text/html; charset=UTF-8',
        'token': getToken()
      },
    })
  }


  /**
   * 修改设备
   * @param param
   * @returns {*}
   */
  dispose = (param) => {
    return axios.request({
      url: '/admin/device/alarm/dispose',
      method: 'post',
      dataType: 'json',
      headers: {
        'Content-Type': 'application/json; charset=UTF-8',
        'token': getToken()
      },
      data: param
    })
  }
}
export default DeviceAlarm;
